package com.wom.player;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;

import com.wom.worldmaker.GameProperties;

public abstract class AbstractCharacter extends Rectangle2D.Float{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final int maxHealth=100;
	private int health;
	private Color color=Color.RED;
	private String name;
	
	
	public AbstractCharacter(int x,int y,Color c,String name){
		
		setFrame(x*GameProperties.playerSize.width,y*GameProperties.playerSize.height,GameProperties.playerSize.width-2,GameProperties.playerSize.height-2);
		setColor(c);
		setName(name);
		
		
		// set health to 100% first
		setHealth(getMaxHealth());
		
	}
	
		
	
	public int getHealth() {
		return health;
	}

	public void setHealth(int health) {
		this.health = health;
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public int getMaxHealth() {
		return maxHealth;
	}

	
	
	
	
	public abstract void renderPlayer(Graphics g);
	public abstract void updatePlayer();


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}
	
	

}
